package com.tjx.controller;


import com.tjx.common.Result;
import com.tjx.entity.TicketVisitor;
import com.tjx.service.ITicketVisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 票-游客信息表 前端控制器
 * </p>
 *
 * @author tjx
 * @since 2025-10-29
 */
@RestController
@RequestMapping("/ticket-visitor")
public class TicketVisitorController {
    @Autowired
    private ITicketVisitorService ticketVisitorService;

    // 批量添加票-游客关联信息
    @RequestMapping("/addBatch")
    public Result<Integer> addBatchTicketVisitor(@RequestBody List<TicketVisitor> ticketVisitors) {
        // 校验输入参数是否为空
        if(ticketVisitors.isEmpty()){
            return Result.fail("输入参数不能为空",0);
        }
        return Result.ok("添加成功",ticketVisitorService.addTicketVisitor(ticketVisitors));
    }
}
